<template>
	<view id="map">
		<statusBar />
		<view class="status_bar">
			<!-- 这里是状态栏 -->
			<image @tap="LeftIndex" src="../../static/images/common/icon_black_back.png" mode=""></image>
			<text>选择门店</text>
		</view>
		<view class="page-body">
			<view class="page-section page-section-gap">
				<map :latitude="latitude" :longitude="longitude" :markers="covers">
				</map>
			</view>
		</view>
	</view>
</template>
<script>
import { mapActions, mapState } from 'vuex';
import { toast } from '@/utils/toast';
import request from '@/utils/request';
import statusBar from '../../components/statusBar/statusBar.vue';
export default {
	data() {
		return {
			title: 'map',
			latitude: 39.909,
			longitude: 116.39742,
			covers: [{
				latitude: 39.9085,
				longitude: 116.39747,
				// #ifdef APP-PLUS
				iconPath: '../../static/images/home/location@3x.png',
				// #endif
				// #ifndef APP-PLUS
				iconPath: '../../static/images/location.png',
				// #endif
			}, {
				latitude: 39.90,
				longitude: 116.39,
				// #ifdef APP-PLUS
				iconPath: '../../static/images/home/location@3x.png',
				// #endif
				// #ifndef APP-PLUS
				iconPath: '../../static/images/location.png',
				// #endif
			}]
		};
	},
	components: {
		statusBar
	},
	computed: {},
	onLoad() {
		uni.getLocation({
			//获取当前的位置坐标
			type: 'wgs84',
			success: function(res) {
				console.log('当前位置的经度：' + res.longitude);
				console.log('当前位置的纬度：' + res.latitude);
			}
		});
	},
	methods: {
		LeftIndex() {
			uni.navigateBack({
				delta: 1
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.status_bar {
	padding: 0 20upx;
	margin-top: 10upx;
	display: flex;
	align-items: center;
	image {
		width: 28upx;
		height: 30upx;
		display: flex;
	}
	text {
		font-size: 28upx;
		font-family: PingFang SC;
		font-weight: bold;
		color: rgba(52, 78, 80, 1);
		margin-left: 20upx;
	}
}
map {
		width: 100%;
		height: 600rpx;
	}
</style>
